/*
 * ikakeibo 0.6.0
 * Copyright (C)2009 wateray and contributors
 * wateray@gmail.com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

package com.wateray.ipassbook.ui.dialog;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;

import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

import com.wateray.ipassbook.kernel.event.IPassbookEvent;
import com.wateray.ipassbook.ui.widget.TitleMessageDialog;
import com.wateray.ipassbook.util.LanguageLoader;


/**
 * @author wateray
 * @create 2009-5-12
 */
public class AboutDialog extends TitleMessageDialog {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private static int width = 540;
	private static int height = 260;
	
	
	public AboutDialog(JFrame owner, String title) {
		this(owner, width, height, true, title);
        this.getFinishButton().setVisible(false);
        this.getCancelButton().setVisible(false);
		getHelpButton().setText(LanguageLoader.getString("Ok"));
	}
	public AboutDialog(JFrame owner, int width, int height, boolean modal,
			String title) {
		super(owner, width, height, modal, title);
		// TODO Auto-generated constructor stub
	}
	
	@Override
	public JComponent getCenterPane() {
		if (centerPane == null) {
			centerPane = new JPanel(new BorderLayout());
			JLabel label = new JLabel();
			label.setAlignmentX(JLabel.CENTER_ALIGNMENT);
			label.setBorder(BorderFactory.createLineBorder(Color.red));
			StringBuffer info = new StringBuffer();
			info.append("<html>");
			info.append("<center><br>author:wateray@gmail.com</center>");
			info.append("<br>Copyright (C) 2009 The iPassbook Team.<br>");
			info.append("</html>");
			
			label.setText(info.toString());
			centerPane.add(label);
		}
		return centerPane;
	}

	/* (non-Javadoc)
	 * @see com.wateray.ipassbook.ui.dialog.TitleMessageDialog#finishButtonActionPerformed(java.awt.event.ActionEvent)
	 */
	@Override
	protected void finishButtonActionPerformed(ActionEvent event) {
		// TODO Auto-generated method stub
		this.dispose();
	}
	@Override
	public void update(IPassbookEvent event) {
		// TODO Auto-generated method stub
		
	}
	
}
